package com.mybatis.example.dao;

import com.mybatis.example.dao.utils.MyBatisUtils;
import com.mybatis.example.pojo.Student;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;
import org.junit.Test;

import java.util.List;

public class testStudentMapper {
    Logger logger =  Logger.getLogger(StudentMapper.class);
    @Test
    public void test(){
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
        List<Student> studentList = mapper.getStudent();

        for (Student student : studentList) {
            System.out.println(student);
        }

        sqlSession.close();
    }
}
